﻿#pragma once

#include <qopenglfunctions.h>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
#include "NewPCIDemoDefine.h"

class AsGLXYZPainter :
	protected QOpenGLFunctions
{
public:
	AsGLXYZPainter();
	~AsGLXYZPainter();

	void setTransformParam(MyGLTransParam inputParam) { m_transformParam = inputParam; };
	void render();

private:
	void initVertex();
	void initializeGL();
	void setupVertexAttribs();
	void clearup();

	MyGLTransParam m_transformParam;
	QOpenGLVertexArrayObject m_vao;
	QOpenGLBuffer m_vbo;
	QOpenGLShaderProgram *m_program;
	int m_projLoc;
	int m_mvLoc;
	QMatrix4x4 m_projMat;
	QMatrix4x4 m_camera;
	QMatrix4x4 m_world;
	QVector<GLfloat> m_vertex;
};